# -*- coding: utf-8 -*-
import json
from urllib import parse
from django.shortcuts import render
from django.http import HttpResponse,HttpResponseRedirect
from django.views.decorators import csrf
import sys
import sqlite3



def index(request):
    conn = sqlite3.connect('db.sqlite3')
    cursor = conn.cursor()
    c = cursor.execute('select * from neihanduanzi where rowid<50')
    list=[]
    for i in c:
        temp={}
        temp['title']=i[0]
        temp['content']=i[1]
        temp['img']=i[2]
        list.append(temp)
    context={'list':list}
    return render(request, 'dzindex.html',context)